Release 10.1A: OpenEdge Development:
Progress Dynamics Advanced Development
Special functions that manage properties
There are some special functions that let you define new properties at run time and also return useful information about standard object properties. This section describes the following functions.
instancePropertyList
This
CHARACTERfunction returns a list of the names of the object’sinstanceProperties, which are properties that can be set to initial values in design mode. You can set these properties in the AppBuilder or in the Container Builder to determine the object instance’s behavior at run time. The list of standard instance properties is part of the definition of the object and stored in itsInstancePropertiesproperty, described just below. If you pass in a blank (“”) for theINPUTparameter, you get back all instance properties and their values. Otherwise, you can pass in a comma-separated list of property names and get the values for just those properties back. If you want values for every property defined for the object, you can pass in an asterisk (“*”) as theINPUTparameter.The
RETURNvalue is a delimited list of property name/value pairs withCHR(3)between pairs andCHR(4)between name and value, as shown:
propertyType
The
propertyTypeCHARACTERfunction returns the data type of a property, as shown:
setUserProperty
This
LOGICALfunction assigns a value to a dynamically defined property and allocates a slot for the property if it does not yet exist. You can usesetUserPropertyto create properties for SmartObjects on the fly, without having to define functions to support them or predefine them in any way. It takes asINPUTparameters the name of the property and the value. Because these ad hoc properties and values are simply stored in a delimited string within the SmartObject, the values are always represented inCHARACTERform, as shown:
getUserProperty
This
LOGICALfunction retrieves the value of a dynamically defined property that you previously defined and set with thesetUserPropertyfunction. The values for these functions are always stored and returned inCHARACTERform, as shown:
InstanceProperties
This
CHARACTERproperty returns the list of instance properties for the object. This list is normally hard-coded in the template for the object type as thexcInstance-Propertiespreprocessor, whose value is then assigned toInstancePropertiesat startup of a static SmartObject. The value is also stored in the Repository for use with dynamic SmartObjects. In earlier product releases, this property was important for the AppBuilder to use when it generated code for use in itsadm-create-objectprocedure. With dynamic windows, the distinction between instance properties and other properties is not as significant, and the value might not be meaningful for most applications.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |